<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>渠道观众数量</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all" />
    <script src="/layuiadmin/layui/layui.js"></script>
</head>

    <body>
        <input type="text" name="viewer_source_count_sum" value="<?php echo json_encode($sum); ?>" style="display: none;">
        <table class="layui-hide" id="viewer_source_count_table"></table>
        <script src="/layuiadmin/layui/layui.js"></script>
        <script src="/assets/cos-js-sdk-v5/cos-js-sdk-v5.min.js"></script>
        <script>
            layui.use('table',function() {
                var table = layui.table;
                // 已知数据渲染
                var inst = table.render({
                    elem: '#viewer_source_count_table',
                    cols: [[ //标题栏
                    {
                        field: 'source_key',
                        title: '渠道码',
                        width: 180,
                        sort: true
                    },
                    {
                        field: 'source_name',
                        title: '渠道',
                        width: 180
                    },
                    {
                        field: 'count',
                        title: '观众人数',
                        minWidth: 120
                    }]],
                    data: <?php echo json_encode($data); ?>, // 绑定数据
                    page: true,
                    // 是否显示分页
                    limits: [5, 10, 15],
                    limit: 10 // 每页默认显示的数量
                });
            });</script>
    </body>

</html>
